<?php
	class QiuzuAction extends BaseAction{
			public function index(){
				if(!$this->isPost()){
					$this->display();
				}else{
				//获得图片
				$pic = $_FILES['img'];
				//获得图的临时路径
				$tmpname = $pic['tmp_name'];
				//获得图片类型
				$type = $pic['type'];
				$type = explode('/',$type);
				$type_1 = $type[0];
				//重新给图片起名
				$picture='fabu_'.time().rand(1000,9999).".".$type[1];
				//上传图片时 的报错
				$error=$pic['error'];
				//图片上传的路径
				$newname=ROOT_DIR.DS.'Public/Upload/'.$picture;
				if(is_uploaded_file($tmpname) && $type_1 == 'image' && $error == '0'){
					move_uploaded_file($tmpname,$newname);
				}					
					$data['shi'] = $_POST['shi'];
					$data['img'] = $picture;
					$data['xian'] = $_POST['xian'];
					$data['title'] = $_POST['title'];
					$data['xiaoqu'] = $_POST['xiaoqu'];
					$data['youxiaoqi'] = $_POST['youxiaoqi'];
					$data['person']  = $_POST['person'];
					$data['dianhua'] = $_POST['dianhua'];
					$ddta['tel'] = $_POST['tel'];
					$data['email'] = $_POST['email'];
					$data['qq'] = $_POST['qq'];
					$data['biaoqian'] = $_POST['biaoqian'];
					$data['zhiding'] = $_POST['zhiding'];
					$data['xingzhi'] = $_POST['xingzhi'];
					$data['money']=$_POST['money'];
					$data['buju']=$_POST['buju'];
					$data['peitao'] = $_POST['peitao'];
					$data['area'] = $_POST['area'];
					$data['zhuangxiu'] = $_POST['zhuangxiu'];
					$data['user'] = $_SESSION['username'];
					$data['louceng'] = $_POST['lou'];
					$data['jiaotong'] = $_POST['gongjiao'];
					$data['xianlu'] = $_POST['xianlu'];
					$data['xiangqing'] = $_POST['info'];
					$data['types'] = $_POST['types'];
					$result = M("send")->data($data)->add();
					if($result){
						$this->assign("jumpUrl","__URL__/index");
						$this->assign("",3);
						$this->success("发布成功，等待审核！！！");
					}
				}
			}
	}

?>

